package com.woniuxy.controller;

import com.woniuxy.entity.RbacRoleMenuDTO;
import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.service.RbacRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/rbacRole")
public class RbacRoleController {
    @Autowired
    RbacRoleService rbacRoleService;

    //查询所有角色信息
    @GetMapping("/findAllRole/{currentPage}/{pageSize}")
    public ResponseEntity findAllRole(@PathVariable int currentPage,@PathVariable int pageSize){
        return rbacRoleService.findAllRole(currentPage,pageSize);
    }

    //根据roleid查询角色信息
    @GetMapping("/checked/{roleId}")
    public ResponseEntity checkedRole(@PathVariable int roleId){
        return rbacRoleService.checkedRole(roleId);
    }
    @PostMapping("/changeMenus")
    public ResponseEntity changeMenus(@RequestBody RbacRoleMenuDTO rbacRoleMenuDTO){
        return rbacRoleService.changeMenus(rbacRoleMenuDTO);
    }
}
